package myky.com.doctorapp.model;

import java.util.HashMap;
import java.util.List;

import io.reactivex.Observable;
import myky.com.doctorapp.api.ApiManager;
import myky.com.doctorapp.base.BaseEntity;
import myky.com.doctorapp.contract.DoctorDeatailsContract;
import myky.com.doctorapp.entity.DoctorEntity;
import myky.com.doctorapp.entity.TeamEntity;
import myky.com.doctorapp.utils.RequestBodyBuilder;
import okhttp3.RequestBody;

public class DoctorDeatailsModel implements DoctorDeatailsContract.Model {
    @Override
    public Observable<BaseEntity<DoctorEntity.PayLoadEntity>> getDoctorDeatails(String doctorId, String version) {


        RequestBodyBuilder.Builder requestBodyBuilder = new RequestBodyBuilder.Builder();

        requestBodyBuilder.params("id", doctorId).params("version", version);

        HashMap<String, String> map = requestBodyBuilder.getMap();

        return ApiManager.getApistore().getDoctorDetails(map);
    }

    @Override
    public Observable<BaseEntity<List<TeamEntity.DataEntity>>> getTeamInfo(String version, String doctorid) {

        RequestBodyBuilder.Builder requestBodyBuilder = new RequestBodyBuilder.Builder();

        RequestBody requestBody = requestBodyBuilder.params("doctorid", doctorid).params("version", version).build();

        return ApiManager.getApistore().getDoctorDetails(requestBody);
    }
}
